﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ComicTool"
                    xmlns:it="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls">
    <Style TargetType="local:ImageEditorContainerEx">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ImageEditorContainerEx">
                    <ScrollViewer x:Name="ScrollViewer"
                                  IsTabStop="False"
                                  HorizontalScrollBarVisibility="Auto"
                                  VerticalScrollBarVisibility="Auto">
                        <Grid x:Name="SelectionArea">
                            <Border HorizontalAlignment="Center"
                                    Height="{Binding Height, ElementName=Image, Mode=OneWay}"
                                    Margin="10"
                                    VerticalAlignment="Center"
                                    Width="{Binding Width, ElementName=Image, Mode=OneWay}">
                                <Grid>
                                    <it:AnimatedImage x:Name="Image"
                                                      AnimationMode="None"
                                                      Source="{TemplateBinding Source}" />
                                    <Canvas x:Name="DrawingCanvas"
                                            RenderTransformOrigin="0,0">
                                        <Canvas.RenderTransform>
                                            <CompositeTransform x:Name="DrawingCanvasScale" />
                                        </Canvas.RenderTransform>
                                    </Canvas>
                                </Grid>
                            </Border>
                        </Grid>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
